<template>
	<view class='load-more'>
		<block v-if="!loading&&noMore">
			<view class="loadmore__line"></view>
			<text class="loadmore__text">{{noMoreText}}</text>
			<view class="loadmore__line"></view>
		</block>
		<block v-if="loading">
			<view class="weui-loading"></view>
			<text class="loadmore__text">{{loadText}}</text>
		</block>
	</view>
</template>

<script>
	export default {
		name: 'load-more',
		props: {
			loadText: {
				type: String,
				default () {
					return '努力加载中'
				}
			},
			noMoreText: {
				type: String,
				default () {
					return '没有更多了'
				}
			},
			noMore: {
				type: Boolean,
				default () {
					return false
				}
			},
			loading: {
				type: Boolean,
				default () {
					return true
				}
			}
		},
		created() {

		},
		data() {
			return {
				
			}
		},
		methods: {
			
		},
	}
</script>

<style>
	.load-more {
		display: flex;
		width: 100%;
		height: 90rpx;
		justify-content: center;
		align-items: center;
	}

	.loading-icon {
		width: 30rpx;
		height: 30rpx;
		margin-right: 8rpx;
		display: inline-block;
		vertical-align: middle;
		animation: weuiLoading 1s steps(12, end) infinite;
		background: url('https://s10.mogucdn.com/mlcdn/c45406/171016_4a61e09hcadd157gadhdeje55e82c_32x32.png') no-repeat;
		-webkit-background-size: 100%;
		background-size: 100%;
	}

	.loadmore__text {
		margin: 0 8rpx 0 8rpx;
		color: #999;
		font-size: 28rpx;
	}

	.loadmore__line {
		width: 100rpx;
		height: 1rpx;
		border-top: 1rpx solid #d2d2d2;
	}

	/* 加载中动画 */
	.weui-loading {
		margin: 0 5px;
		width: 20px;
		height: 20px;
		display: inline-block;
		vertical-align: middle;
		-webkit-animation: a 1s steps(12) infinite;
		animation: a 1s steps(12) infinite;
		background: transparent url() no-repeat;
		background-size: 100%
	}

	.weui-loading.weui-loading_transparent {
		background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")
	}

	@-webkit-keyframes a {
		0% {
			-webkit-transform: rotate(0deg);
			transform: rotate(0deg)
		}

		to {
			-webkit-transform: rotate(1turn);
			transform: rotate(1turn)
		}
	}

	@keyframes a {
		0% {
			-webkit-transform: rotate(0deg);
			transform: rotate(0deg)
		}

		to {
			-webkit-transform: rotate(1turn);
			transform: rotate(1turn)
		}
	}
</style>
